<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">

<title>历史信息</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" href="css/vivo.css">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="js/bootstrap2/css/bootstrap.min.css">
<link rel="stylesheet" href="js/bootstrap2/css/bootstrap-table.css">
<link rel="stylesheet" href="css/common.css">

<script src="js/jquery-1.11.1.js"></script>
<script src="js/form.js"></script>
<script src="js/sharefunction.js"></script>
<script src="js/bootstrap2/js/bootstrap.min.js"></script>
<script src="js/bootstrap2/js/bootstrap-table.js"></script>
<script src="js/bootstrap2/js/bootstrap-table-zh-CN.js"></script>
<script type="text/javascript" src="js/layui-v2.1.5/layui/layui.all.js"></script>
<script type="text/javascript"
	src="<%=basePath%>js/My97DatePicker/WdatePicker.js"></script>

<script type="text/javascript">
	//修改字段标记记录变量
	<c:set var="marks" value="原数据"/>
</script>
</head>
<body>
	<!-- 历史信息 -->
	<div style="padding:10px 20px">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h5 class="panel-title">控规指标</h5>
			</div>
			<div class="panel-body">
				<div>
					<table cellpadding="10" cellspacing="5" class="mytable" >
						<tr>
							<td width="70">立项名称</td>
							<td width="240"><input name="projectApprovalName"  class="toolTip" data-tip="${requestScope.paStage.projectApprovalName }" id="projectApprovalName" value="${requestScope.paStage.projectApprovalName }" />
								<c:if test="${not empty requestScope.map.projectApprovalName }"><span class="toolTip mark-msg" data-tip="${requestScope.map.projectApprovalName }" >
									<c:out value="${marks}"/></span>
								</c:if>
							</td>
							<td width="70">立项时间</td>
							<td><input name="projectApprovalDate" readonly="readonly"
								value="<fmt:formatDate value="${requestScope.paStage.projectApprovalDate }" pattern="yyyy-MM-dd" />" id="projectApprovalDate" class="Wdate"
								onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
								<c:if test="${not empty requestScope.map.projectApprovalDate }"><span class="toolTip mark-msg" data-tip="<fmt:formatDate  value="${requestScope.map.projectApprovalDate }" type="both" pattern="yyyy-MM-dd" />">
									<c:out value="${marks}"/></span>
								</c:if>
							</td>
							<td width="70">立项单位</td>
							<td colspan="3"><input name="projectApprovalUnit"
								id="projectApprovalUnit"
								value="${requestScope.paStage.projectApprovalUnit }" class="input_name"/>
								<c:if test="${not empty requestScope.map.projectApprovalUnit }"><span class="toolTip mark-msg" data-tip="${requestScope.map.projectApprovalUnit }" >
									<c:out value="${marks}"/></span>
								</c:if>
							</td>
						</tr>
						<tr>
							<td>备注信息</td>
							<td colspan="3"><textarea style="width:70%;" rows="3" maxlength="200"
								name="projectApprovalRemark" id="projectApprovalRemark" onkeydown="checkMaxInput(this,200)"  
           						onkeyup="checkMaxInput(this,200)" onfocus="checkMaxInput(this,200)" onblur="checkMaxInput(this,200);resetMaxmsg()">${requestScope.paStage.projectApprovalRemark }</textarea>
								<c:if test="${not empty requestScope.map.projectApprovalRemark }"><span class="toolTip mark-msg" data-tip="${requestScope.map.projectApprovalRemark }" >
									<c:out value="${marks}"/></span>
								</c:if>
							</td>
						</tr>
					</table>
					<input type="hidden" id="entityId_id" name="entityId_id" value="${requestScope.paStage.id }" />
					<input type="hidden" id="apId" name="apId" value="${apId }" />
				</div>
			</div>
		</div>
		<c:if test="${requestScope.notPassExamine}">
			<!-- 修改时添加变更说明 -->
			<div style="margin:10px;"  id="approvalRemark">
				审批意见<textarea rows="3" name="approvalRemark"style="width:70%"></textarea><span style="color:red;">*</span>
			</div>
			<div style="width:100%;text-align:center; padding-top:0px">
				<button class="btn btn-danger radius my-btn"
					onclick="saveDocument(0)" type="button">同意</button>
				<button class="btn btn-default radius"
					onclick="saveDocument(1)" type="button">拒绝</button>
				<br />
			</div>
		</c:if>
	</div>

	<script type="text/javascript">
	
	$(function() {
		//如果已经保存过了，则开启只读状态
		<c:if test="${not empty requestScope.paStage }">
			$("td").find("input,textarea").attr("readonly",true);
			$("input[name='projectApprovalDate']").attr("disabled",true);
		</c:if>
		toolTip();
	})
	
	function saveDocument(opt){
		var url = "project/approval/disposeApproval";
		var apId = '${requestScope.apId }';
		var exDataId = '${exDataId}';
		var approvalRemark = $("textarea[name='approvalRemark']").val();
		if(apId!="" && apId!=null && apId!=undefined){
			if(approvalRemark==""){
				layer.alert("审批说明不能为空");
				layer.close(i);
				return null;
			}
		}
		var formData = {
				exDataId:exDataId,
	        	opt:opt,
	        	apId:apId,
	        	approvalRemark:approvalRemark
	    };
		disposeSave(opt,url,formData);
	}
	//关闭当前窗体
	function bnClose() {
		parent.layer.closeAll();
	}
	
</script>
	<script src="js/select2/select2.min.js"></script>
	<script type="text/javascript" src="js/sharefunction.js"></script>
</body>
</html>
